package com.imooc.test;

import java.math.BigDecimal;

/**
 * @Description:
 * @Auther: sixbing  QQ:414409451
 * @Date: 2018/11/15 16:53
 */
public class demo {
    public static void main(String[] args) {
        int d1 = 30;
        int d2 = 40;
        calculatDistence(d1, d2);
    }

    private static void calculatDistence(int d1, int d2) {
        int dddd = 100 * d1 / d2;

        int d = (int) (new BigDecimal((double) d1 / (double) d2).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() * 100);
        System.out.println(d);
        System.out.println(dddd);
    }
}
